using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Graphics;

namespace One_Crappy_RPG
{
    public static class InputManager
    {
        static KeyboardState oldKeys = Keyboard.GetState();
        static KeyboardState newKeys = Keyboard.GetState();
        public static SpriteFont Font;

        public static bool IsKeyPressed(Keys key)
        {
            return newKeys.IsKeyDown(key);
        }

        public static bool WasNewKeyPress(Keys key)
        {
            return (oldKeys.IsKeyUp(key) && newKeys.IsKeyDown(key));
        }

        public static bool WasNewKeyRelease(Keys key)
        {
            return (oldKeys.IsKeyDown(key) && newKeys.IsKeyUp(key));
        }

        public static bool IsKeyHeld(Keys key)
        {
            return (oldKeys.IsKeyDown(key) && newKeys.IsKeyDown(key));
        }
        public static void Update()
        {
            oldKeys = newKeys;
            newKeys = Keyboard.GetState();
        }
    }
}
